package com.burry.services;

import java.util.List;

import com.burry.db.SQLMachine;

public class ModelService {
	
	public List getAllModel(){
		String sql = "select * from bu_sale_model";
		SQLMachine sqlM = new SQLMachine("default");
		return sqlM.getResultSet(sql);
	}
	
	public void saveGlobalModel(String beginDate,String endDate,String modelType,String disType,String disValue,String plusValue){
		String sql = "insert into bu_sale_model(begin_date,end_date,dis_type,dis_amt,plusSome,model_type) values('"+beginDate+"','"+endDate+"','"+disType+"',"+disValue+","+plusValue+",'"+modelType+"')";
		SQLMachine sqlM = new SQLMachine("default");
		sqlM.updateResult(sql);
	}
	
	public void saveCataModel(String beginDate,String endDate,String modelType,String disType,String disValue,String plusValue,String catalog,String catalogNum,String goodId){
		String sql = "insert into bu_sale_model(begin_date,end_date,dis_type,dis_amt,plusSome,model_type,cata_range,cata_qty,good_range) values('"+beginDate+"','"+endDate+"','"+disType+"',"+disValue+","+plusValue+",'"+modelType+"','"+catalog+"','"+catalogNum+"','"+goodId+"')";
		SQLMachine sqlM = new SQLMachine("default");
		sqlM.updateResult(sql);
	}
}
